package top.dreamyy.pattern.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import top.dreamyy.pattern.domain.Menu;
import top.dreamyy.pattern.domain.Pattern;

import static top.dreamyy.pattern.util.common.PatternConstants.PATTERNTABLE;

import java.util.List;

import static top.dreamyy.pattern.util.common.PatternConstants.MENUTABLE;
import static top.dreamyy.pattern.util.common.PatternConstants.SUGGESTTABLE;

public interface PatternDao {
	
	//查询数据
	@Select("select * from "+PATTERNTABLE+" where pid = #{id}")
	Pattern selectPattern(int id);
	
	@Select("select * from "+MENUTABLE+" ")
	List<Menu> selectMenu();
	
	@Insert("insert into "+SUGGESTTABLE + " values(#{sugg})")
	int insertSugg(String sugg);
}
